class Truck extends Car{
    private double payload; // 载重量
    // 构造方法
    public Truck(){

    }
    public Truck(int wheel,double weight,int loader,double payload){
        super(wheel,weight,loader);
        this.payload = payload;
    }
    // set,get方法
    public double getpayload(){
        return payload;
    }
    public void setPayload(double payload){
        this.payload = payload;
    }
    // 判断是否超载
    public void isLoader(){
        if(super.getLoader()>2){
            System.out.println("此Truck对象超载!");
        }else{
            System.out.println("此Truck对象搭载了 "+super.getLoader()+" 名乘客!");
        }
    }
    // 判断是否超重
    public void isOverweiht(){
        if(payload>1000){
            System.out.println("此Truck对象超重!");
        }else{
            System.out.println("此Truck对象载重 "+payload);
        }
    }
}
